package com.zhanghaojia.wyn.controller;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @author 张好佳
 * @date 2021年12月26日 12:45 PM
 */
@Api(tags = "测试接口")
@RestController
@RequestMapping("/wyn")
public class WynController {

    @ApiOperation(value = "接收一个json返回一个json", response = String.class)
    @ApiResponses(@ApiResponse(code = 200, message = "OK"))
    @PostMapping(value = "/post")
    public ResponseEntity<JSONObject> getMouthData(@RequestBody JSONObject param) {
        return new ResponseEntity<>(param, HttpStatus.OK);
    }

    @ApiOperation(value = "接收一个字符串返回一个字符串", response = String.class)
    @ApiResponses(@ApiResponse(code = 200, message = "OK"))
    @GetMapping(value = "/get")
    public ResponseEntity<String> getMouthData(@RequestBody String param) {
        System.out.println("测试修改");
        return new ResponseEntity<>(param, HttpStatus.OK);
    }

}

